<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div class="d" style="background-color: red; height: 100px; width: 100px;">
        <p>sadadadadas <span>0</span></p>
    </div>
    <div class="d1"  style="background-color: blue; height: 100px; width: 100px;">
            <p>sadadadadas <span>0</span></p>
        </div>
    <script src="js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
            let x=0;
            let y=0;
            $('.d').mouseenter(function(){
                // 只作用于当前div，不包括子元素
                alert(1)
                $('d>p>span').text(x+=1)
            })
            $('.d1').mouseover(function(){
                // 作用于当前div，包括子元素
                alert(1)
                $('d1>p>span').text(y+=1)
            })
        })
    </script>
</body>
</html>